<template>
  <el-radio-group :value="value" @input="handleChange">
    <el-radio v-for="option in options" :key="option.value" :label="option.value">{{ option.label }}</el-radio>
  </el-radio-group>
</template>

<script>
export default {
  props: {
    value: {
      type: [String, Number],
      required: true
    },
    options: {
      type: [Array],
      default: () => {
        return [
          {
            label: '男',
            value: '男'
          },
          {
            label: '女',
            value: '女'
          }
        ]
      }
    }
  },
  data() {
    return {
      radio: this.options[0].value
    }
  },
  methods: {
    handleChange(val) {
      this.$emit('input', val)
    }
  }
}
</script>
